
import { memo, PureComponent } from 'react'
import { Link } from 'react-router-dom';
import ArticlesList from '../ArticlesList'
import Profile from './index'

const mock = {
    profile:{
        username:'lis',
        avatar:'https://gu0nuli.github.io/reactStatic/react_static/v1_111.jpg',
        bio:'lis bio',
        email:'lis@qq.com',
        following:false
    },
    currentUser:{
        username:'li',
        avatar:'https://gu0nuli.github.io/reactStatic/react_static/v1_111.jpg',
        bio:'li bio',
        email:'li@qq.com',
    },
    article:{
        "articles": [
            {
                "slug": "1371cdf8",
                "title": "你好aa",
                "description": "html 你好aa",
                "body": "html 你好aa",
                "createdAt": "2022-01-20T05:28:57.000Z",
                "updatedAt": "2022-01-20T05:28:57.000Z",
                "userEmail": "lisi@qq.com",
                "tags": [
                    "html",
                    "tag1"
                ],
                "author": {
                    "username": "lisi",
                    "email": "lisi@qq.com",
                    "bio": null,
                    "avatar": null
                },
                "isFavorite": false,
                "favoriteCount": 55
            },
            {
                "slug": "1371cdf8",
                "title": "你好aa",
                "description": "html 你好aa",
                "body": "html 你好aa",
                "createdAt": "2022-01-20T05:28:57.000Z",
                "updatedAt": "2022-01-20T05:28:57.000Z",
                "userEmail": "lisi@qq.com",
                "tags": [
                    "html",
                    "tag1"
                ],
                "author": {
                    "username": "lisi",
                    "email": "lisi@qq.com",
                    "bio": null,
                    "avatar": null
                },
                "isFavorite": true,
                "favoriteCount": 33
            },
            {
                "slug": "1371cdf8",
                "title": "你好aa",
                "description": "html 你好aa",
                "body": "html 你好aa",
                "createdAt": "2022-01-20T05:28:57.000Z",
                "updatedAt": "2022-01-20T05:28:57.000Z",
                "userEmail": "lisi@qq.com",
                "tags": [
                    "html",
                    "tag1"
                ],
                "author": {
                    "username": "lisi",
                    "email": "lisi@qq.com",
                    "bio": null,
                    "avatar": null
                },
                "isFavorite": false,
                "favoriteCount": 55
            },
        ],
        "articlesCount": 3
    }

}

class ProfileFavorite extends Profile {
    renderTag = () => {
        return (
            <ul className="nav nav-pills outline-active" >
                <li className='nav-item' >
                    <Link className="nav-link " to={`/${mock.currentUser.username}/profile`}>
                        <i class="fa fa-heart-o"></i> 我的文章
                    </Link>
                </li>
                <li className='nav-item' >
                    <Link className="nav-link active" to={`/${mock.currentUser.username}/favorites`}>
                        <i class="fa fa-heart-o"></i> 喜欢文章
                    </Link>
                </li>
            </ul>
        )
    }
    componentDidMount() {
        //作者信息
        //作者喜欢的文章
    }
}

export default ProfileFavorite;
